/**
 * 医疗空间数字孪生 - 设计系统统一导出
 * 提供设计系统的所有类型、工具函数和常量
 */

// 导出所有类型定义
export type * from './types';

// 导出工具函数
export {
  getCSSVariable,
  setCSSVariable,
  setCSSVariables,
  cn,
  getResponsiveValue,
  getCurrentBreakpoint,
  watchBreakpoint,
  theme,
  color,
  spacing,
  animation,
  media,
  a11y,
  performance,
  validation
} from './utils';

// 导出具体的类型（便于解构使用）
export type {
  ButtonVariant,
  ButtonSize,
  CardVariant,
  AlertVariant,
  StatusType,
  TrajectoryType,
  Breakpoint,
  CSSVariable,
  SpacingValue,
  RadiusValue,
  ShadowValue,
  ButtonProps,
  CardProps,
  KPICardProps,
  AlertTagProps,
  StatusIndicatorProps,
  TimelineProps,
  HeatmapLegendProps,
  FloorSwitcherProps,
  ViewerControlProps,
  PerformanceMetricProps,
  CloudRenderStatusProps,
  ThemeConfig,
  ResponsiveValue,
  AnimationConfig,
  A11yProps,
  ClickHandler,
  ChangeHandler,
  KeyboardHandler,
  HeatmapData,
  TrajectoryPoint,
  FloorPlan,
  KPIData,
  LoadingState,
  ErrorState,
  ApiResponse,
  PaginatedResponse
} from './types';

// 设计令牌常量
export const DESIGN_TOKENS = {
  colors: {
    primary: {
      50: '#e8f4ff',
      100: '#c5e5ff',
      200: '#a1d3ff',
      300: '#7dc1ff',
      400: '#58afff',
      500: '#3498ff',
      600: '#2c80d4',
      700: '#2468aa',
      800: '#1c5080',
      900: '#143855'
    },
    secondary: {
      50: '#f0f9f0',
      100: '#daf2da',
      200: '#c4ebc4',
      300: '#aee4ae',
      400: '#98dd98',
      500: '#82d682',
      600: '#6cb46c',
      700: '#569256',
      800: '#407040',
      900: '#2a4e2a'
    },
    gray: {
      50: '#fafafa',
      100: '#f5f5f5',
      200: '#eeeeee',
      300: '#e0e0e0',
      400: '#bdbdbd',
      500: '#9e9e9e',
      600: '#757575',
      700: '#616161',
      800: '#424242',
      900: '#212121'
    },
    semantic: {
      success: '#4caf50',
      warning: '#ff9800',
      error: '#f44336',
      info: '#2196f3'
    },
    visualization: {
      heatmapLow: '#d8e6ff',
      heatmapMedium: '#3498ff',
      heatmapHigh: '#ff5252',
      trajectoryNormal: '#82d682',
      trajectoryEmergency: '#ff5252',
      bottleneck: '#ff9800',
      optimizedPath: '#9c27b0'
    },
    threeD: {
      wall: '#e0e0e0',
      floor: '#f5f5f5',
      door: '#bbbbbb',
      window: '#a0d0ff',
      asset: '#b388ff'
    }
  },
  spacing: {
    1: '4px',
    2: '8px',
    3: '12px',
    4: '16px',
    5: '24px',
    6: '32px',
    7: '48px',
    8: '64px'
  },
  radius: {
    small: '4px',
    medium: '8px',
    large: '16px',
    full: '9999px'
  },
  shadows: {
    1: '0 2px 4px rgba(0, 0, 0, 0.1)',
    2: '0 4px 8px rgba(0, 0, 0, 0.12)',
    3: '0 8px 16px rgba(0, 0, 0, 0.14)'
  },
  breakpoints: {
    xs: '0px',
    sm: '600px',
    md: '960px',
    lg: '1280px',
    xl: '1920px'
  }
} as const;

// 常用的 CSS 类名组合
export const CSS_CLASSES = {
  buttons: {
    primary: 'btn btn-primary',
    secondary: 'btn btn-secondary',
    outline: 'btn btn-outline',
    ghost: 'btn btn-ghost',
    small: 'btn btn-small',
    large: 'btn btn-large'
  },
  cards: {
    default: 'card',
    elevated: 'card card-elevated',
    compact: 'card card-compact',
    kpi: 'kpi-card'
  },
  alerts: {
    critical: 'alert-tag alert-tag-critical',
    warning: 'alert-tag alert-tag-warning',
    info: 'alert-tag alert-tag-info',
    success: 'alert-tag alert-tag-success'
  },
  status: {
    online: 'status-indicator status-online',
    offline: 'status-indicator status-offline',
    warning: 'status-indicator status-warning'
  },
  layouts: {
    flex: 'flex',
    flexCol: 'flex flex-col',
    flexCenter: 'flex items-center justify-center',
    flexBetween: 'flex items-center justify-between',
    grid: 'grid',
    gridCols2: 'grid grid-cols-2',
    gridCols3: 'grid grid-cols-3',
    gridCols4: 'grid grid-cols-4'
  },
  spacing: {
    m1: 'm-1', m2: 'm-2', m3: 'm-3', m4: 'm-4', m5: 'm-5', m6: 'm-6',
    p1: 'p-1', p2: 'p-2', p3: 'p-3', p4: 'p-4', p5: 'p-5', p6: 'p-6',
    gap1: 'gap-1', gap2: 'gap-2', gap3: 'gap-3', gap4: 'gap-4', gap5: 'gap-5', gap6: 'gap-6'
  },
  text: {
    primary: 'text-primary',
    secondary: 'text-secondary',
    disabled: 'text-disabled',
    success: 'text-success',
    warning: 'text-warning',
    error: 'text-error',
    info: 'text-info',
    xs: 'text-xs',
    sm: 'text-sm',
    base: 'text-base',
    lg: 'text-lg',
    xl: 'text-xl',
    '2xl': 'text-2xl',
    '3xl': 'text-3xl'
  }
} as const;

// 医疗特定的组件类名
export const MEDICAL_CLASSES = {
  heatmap: {
    container: 'heatmap-container',
    legend: 'heatmap-legend',
    legendLow: 'heatmap-legend-item heatmap-legend-low',
    legendMedium: 'heatmap-legend-item heatmap-legend-medium',
    legendHigh: 'heatmap-legend-item heatmap-legend-high',
    controls: 'heatmap-controls',
    slider: 'heatmap-intensity-slider'
  },
  timeline: {
    container: 'timeline-container',
    header: 'timeline-header',
    title: 'timeline-title',
    timeDisplay: 'timeline-time-display',
    track: 'timeline',
    progress: 'timeline-progress',
    handle: 'timeline-handle',
    controls: 'timeline-controls',
    playBtn: 'timeline-play-btn',
    speedControl: 'timeline-speed-control'
  },
  viewer: {
    controls: 'viewer-controls',
    control: 'viewer-control',
    controlGroup: 'viewer-control-group',
    controlActive: 'viewer-control active'
  },
  floor: {
    switcher: 'floor-switcher',
    item: 'floor-item',
    itemActive: 'floor-item active'
  },
  trajectory: {
    controls: 'trajectory-controls',
    legend: 'trajectory-legend',
    legendItem: 'trajectory-legend-item',
    normal: 'trajectory-normal',
    emergency: 'trajectory-emergency',
    bottleneck: 'trajectory-bottleneck',
    optimized: 'trajectory-optimized'
  },
  performance: {
    panel: 'performance-panel',
    metric: 'performance-metric',
    metricLabel: 'performance-metric-label',
    metricValue: 'performance-metric-value',
    metricUnit: 'performance-metric-unit',
    metricTrend: 'performance-metric-trend'
  },
  cloudRender: {
    status: 'cloud-render-status',
    loading: 'cloud-render-status cloud-render-loading',
    connected: 'cloud-render-status cloud-render-connected',
    error: 'cloud-render-status cloud-render-error'
  }
} as const;

// 动画预设
export const ANIMATIONS = {
  transitions: {
    fast: 'transition-fast',
    normal: 'transition',
    slow: 'transition-slow'
  },
  springs: animation.spring,
  durations: {
    fast: 150,
    normal: 200,
    slow: 300
  }
} as const;

// 可访问性常量
export const A11Y = {
  roles: {
    button: 'button',
    tab: 'tab',
    tabpanel: 'tabpanel',
    dialog: 'dialog',
    alert: 'alert',
    status: 'status'
  },
  ariaLabels: {
    close: '关闭',
    menu: '菜单',
    search: '搜索',
    previous: '上一个',
    next: '下一个',
    play: '播放',
    pause: '暂停',
    loading: '加载中',
    error: '错误',
    success: '成功'
  }
} as const;

// 默认导出设计系统对象
export default {
  DESIGN_TOKENS,
  CSS_CLASSES,
  MEDICAL_CLASSES,
  ANIMATIONS,
  A11Y,
  utils: {
    getCSSVariable,
    setCSSVariable,
    setCSSVariables,
    cn,
    getResponsiveValue,
    getCurrentBreakpoint,
    watchBreakpoint,
    theme,
    color,
    spacing,
    animation,
    media,
    a11y,
    performance,
    validation
  }
}; 